package com.huawei;

/**
 * Created by Z-hong on 2024/7/22.
 */
import java.util.*;
public class HJ63 {
    public static final String DNA="CG";
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count=sc.nextInt();
        String str=sc.next();
        char[] charArray = str.toCharArray();

        int max=0;
        int res=0;
        int i=0;
        int j=count;
        for (int k = 0; k < count; k++) {
            if(DNA.contains(String.valueOf(charArray[k]))){max++;}
        }
        int now=max;
        while(j<str.length()){
            int temp=now;
            if(DNA.contains(String.valueOf(charArray[j]))){temp++;}
            if(DNA.contains(String.valueOf(charArray[i]))){temp--;}
            if(temp>max){
                max=temp;
                res=i+1;
            }
            now=temp;
            i++;
            j++;
        }
        System.out.println(str.substring(res,res+count));
    }
}
